﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SchoolDatabase
{
    class Student
    {
        private enum Gender { male, female };

        private string name;
        private int number;        
        private Gender gender;

        private Student(string name, int number)
        {
            if (name.Length >= 10 && name.Length <= 50)
                this.name = name;
            else
                throw new InvalidStudentException("The name is not in required length");
            if (number >= 1 && number <= 11)
                this.number = number;
            else
                throw new InvalidStudentException("The number must be in [1..11]");
        }

        public Student(string name, int number, string gender):this(name,number)
        {
            switch (gender)
            {
                case "male":
                    {
                        this.gender = Gender.male;
                    }
                    break;
                case "female":
                    {
                        this.gender = Gender.female;
                    }
                    break;
                default:
                    throw new InvalidStudentException("gender must be 'male' or 'female'");
            }
        }
        
    }
}
